using UnityEngine;

public class MoveJoystick : MonoBehaviour
{
	public GameObject joystickObject;

	private UIJoystick jScript;

	private void Start()
	{
		if (joystickObject != null)
		{
			jScript = joystickObject.GetComponent<UIJoystick>();
		}
	}

	private void OnPress(bool isDown)
	{
		if (joystickObject != null)
		{
			joystickObject.SendMessage("OnPress", isDown);
		}
	}

	private void OnDrag(Vector2 delta)
	{
		if (jScript != null)
		{
			jScript.OnDrag(delta);
		}
	}

	public bool isJoystickMoving()
	{
		if (jScript != null)
		{
			return jScript.position != Vector2.zero;
		}
		return false;
	}
}
